//
//  NSString+Json.h
//
//  Created by BruceYu on 14-8-19.
//  Copyright (c) 2014年 BruceYu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (Json)

- (NSDictionary *)jsonDictionary;

- (NSArray *)jsonArray;

@end


@interface NSDictionary (JsonString)
-(NSString *)jsonString;
@end

@interface NSDictionary (data)
-(NSData *)dataFromDictionary;
@end

@interface NSArray (JsonString)
-(NSString *)jsonString;
+(NSArray *)dataForPlist:(NSString *)plist;
@end



@interface NSObject (LHModelOperation)
//model转字典
- (NSDictionary*)getDic;
//字典转model
+ (id)modelWithDictory:(NSDictionary*)dic;

@end



@interface NSString (data)
/** <将字符串转data> */
-(NSData *)dataUTF8String;
@end

@interface NSString (url)

+(NSString *)urlWithDic:(NSDictionary *)dic;

@end




@interface NSString (Separated)
-(NSArray *)onArraybyString:(NSString *)string;
@end

@interface NSObject (ID)
//将ID转化为字符串
-(NSString *)Id;

@end


@interface NSData (Encrypt)


@property(nonatomic,readonly,getter=isEmpty) BOOL empty;

- (NSString *)UTF8String;

@end

@interface NSData (Array)
/** <将data转array> */
-(NSArray *)onArrayByData;
/** <将data转Image> */
-(UIImage *)onImageByData;
@end



@interface NSURL (string)
/** <将URL转字符串> */
-(NSString *)onStringByURL;

@end

@interface NSURL (data)
/** <将URL转Data> */
-(NSData *)onDataByURL;
@end




//if ([CLLocationManager authorizationStatus] ==kCLAuthorizationStatusDenied) {
//    NSLog(@"没有定位权限");
//}
//AVAuthorizationStatus statusVideo = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
//if (statusVideo == AVAuthorizationStatusDenied) {
//    NSLog(@"没有摄像头权限");
//}
////是否有麦克风权限
//AVAuthorizationStatus statusAudio = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
//if (statusAudio == AVAuthorizationStatusDenied) {
//    NSLog(@"没有录音权限");
//}
//[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
//    if (status == PHAuthorizationStatusDenied) {
//        NSLog(@"没有相册权限");
//    }
//}];
